package com.dm.flyweight.demo02;

import java.util.List;
import java.util.ArrayList;

public class OwnColumn implements Glyph{
	
	List<OwnCharacter> characters = new ArrayList<>();
	
	public void addcharacter(OwnCharacter character){
		this.characters.add(character);
	}

	@Override
	public void draw(GlyphContext context) {
		context.content.append("|");
		for (int i = 0; i < this.characters.size(); i++) {
			this.characters.get(i).draw(context);
		}
	}

	@Override
	public void intersects(String point, GlyphContext context) {
		context.add(this);
	}

}
